import Vue from 'vue'
import App from './App.vue'
import router from './router/index'
import store from './store/index'

import ElementUI from 'element-ui'
import '@/style/global'

// 引入封装好的WEBSOCKET库
import WSocket from '@/utils/socket'

// 引入自定义指令
import clickOutside from '@/utils/directive.js'
// 引入复制到粘贴板插件
import VueClipboard from 'vue-clipboard2'

import VueLazyload from 'vue-lazyload'

import filters from './filters/index'

// 注册全局自定义过滤器
Object.keys(filters).forEach(v => {
    Vue.filter(v, filters[v])
})
// 定义全局SOCKET对象
Vue.prototype.$socket = WSocket

Vue.use(ElementUI)
Vue.use(VueClipboard)
Vue.use(VueLazyload, {
    preLoad: 1.3,
    attempt: 1
})
Vue.config.productionTip = false

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
